home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Pascal / Applications / P4⁄Mac 2.0d4 / Mac source 2.0 / P4Edit.p < prev    next >
Encoding:
Text File  |  1996-09-28  |  1.3 KB  |  59 lines  |  [TEXT/PJMM]

  1. {P4/Mac port by Ingemar Ragenamlm 1994-1996}
  2. { Based on DumbEdit - Multiple-window TransEdit Demonstration.}
  3.  
  4. program P4Edit;
  5.  
  6.     uses
  7. {$IFC UNDEFINED THINK_PASCAL}
  8.         Types, QuickDraw, Windows, Dialogs, ToolUtils, Events, Controls, {}
  9.         Memory, Sound, OSUtils, MixedMode, 
  10. {$ENDC}
  11.         TransEdit, TransSkel, TransDisplay, EditWindow, Run, Messages;
  12.  
  13.     const
  14.         aboutAlrt = 1000;
  15.     var
  16.         pascalMenu: MenuHandle;
  17.  
  18.     procedure DoAbout;
  19.         var
  20.             ignore: integer;
  21.     begin
  22.         ignore := Alert(aboutAlrt, nil);
  23.     end;
  24.  
  25. {    Initialize TransSkel, create menus and install handlers.}
  26.  
  27.     procedure DoPascalMenu (item: integer);
  28.     begin
  29.         case item of
  30.             1: 
  31.                 Run;
  32.             3: 
  33.                 Compile; {Compile to pcode}
  34.             4: 
  35.                 RunPcode; {Run pcode}
  36.         end; {case}
  37.     end; {DoPascalMenu}
  38.  
  39. begin
  40.     SkelInit(6, nil);
  41.  
  42.     TransEditInit;
  43.     SetEWindowCreator('p4’M');                        {P4/Mac creator code}
  44.  
  45.     TransDisplayInit;
  46.     SkelApple('About P4Mac…', @DoAbout);
  47.  
  48.     InitEditWindow;
  49.     messagesWind := GetNewDWindow(128, WindowPtr(-1));
  50.  
  51.     pascalMenu := NewMenu(1005, 'Pascal');
  52. {DisableItem(pascalMenu, 0); <- SynchMenus borde aktivera denna när främsta fönstret är editförnster!}
  53.     AppendMenu(pascalMenu, 'Compile and run/R;(-;Compile to pcode/M;Run pcode/G');
  54.     if Skelmenu(pascalMenu, @DoPascalMenu, nil, true) then
  55.         ;
  56.  
  57.     SkelMain;
  58.     SkelClobber;
  59. end.